-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completely drop Python 3.7 compatibility #1459
Conversation
* Latest Django 4.2 no longer supports Python 3.7 * Our CI dependency `pre-commit` no longer supports Python 3.7 * Python 3.7 support ends in 2 months (https://endoflife.date/python) * We can clean up a few type stubs
Tuple[str, _AttachmentContent] | ||
| Tuple[Optional[str], _AttachmentContent, str] | ||
| Tuple[str, _AttachmentContent, None] | ||
tuple[str, _AttachmentContent] | tuple[str | None, _AttachmentContent, str] | tuple[str, _AttachmentContent, None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm? These comments were referencing Python 3.7, but I'm not sure whether this has anything to do with Python 3.7.
str | None
or tuple[str]
don't work on Python 3.8 runtime either.
But AFAIK it doesn't matter since .pyi
files are only evaluated by mypy, not Python itself. Maybe I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are parsed by python, but not executed. I don't remember the origin of this comment, but I am happy that it is removed now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are parsed by python, but not executed.
Genuinely interested, when does Python parse .pyi
files?
Is this somehow related to the ast
module (which used to be typed_ast
but got merged into Python 3.8's ast
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. mypy
uses ast.parse
to get the Python's AST and then mypy
builds its own AST around it.
Anyone who wants to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except this change: https://github.com/typeddjango/django-stubs/blob/master/.pre-commit-config.yaml#L19
Ah thanks! You already mentioned it in typeddjango/djangorestframework-stubs#399 but I forgot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
pre-commit
no longer supports Python 3.7 (Bump pre-commit from 2.21.0 to 3.2.2 #1422)Related issues